package com.css.dzj.dzjportal.modules.zfjginfo;


import com.css.dzj.dzjportal.common.util.R;
import com.css.dzj.dzjportal.common.util.http.HttpClientUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 获取执法监管任务信息
 */
@RequestMapping("/taskinfo")
@RestController
public class TaskInfoController {

    @Value("${ZFJG_URL}")
    private String zfjgUrl;


    @GetMapping("/getOvertimeCount")
    public R getOvertimeCount() {
        try {
            String result =  HttpClientUtil.doGet(zfjgUrl + "/lhjgrwbl/queryOvertimeCount");
            if(StringUtils.isEmpty(result)){
                result = "0";
            }
            System.out.println(result);
            return R.ok().put("data", result);
        } catch (Exception e) {
            return R.error();
        }
    }


    @GetMapping("/getOveramountCount")
    public R getOveramountCount() {
        try {
            String result =  HttpClientUtil.doGet(zfjgUrl + "/lhjgrwbl/queryOveramountCount");
            if(StringUtils.isEmpty(result)){
                result = "0";
            }
            System.out.println(result);
            return R.ok().put("data", result);
        } catch (Exception e) {
            return R.error();
        }
    }
}
